package com.leixin.demo.dao;

import com.leixin.demo.entity.UserEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDao {
    @Select("SELECT * FROM user WHERE id = #{id}")
//    @Results({
//            @Result(property = "id", column = "id"),
//            @Result(property = "provinceId", column = "province_id"),
//            @Result(property = "cityName", column = "city_name"),
//            @Result(property = "description", column = "description")
//    })
    public UserEntity queryUserById(@Param("id") String id);

    @Insert("INSERT INTO user (id,name, password) VALUES (#{id},#{name}, #{password})")
    public void addUser(UserEntity userEntity);
}

